package com.pasabahceambalaj.session;

import com.pasabahceambalaj.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("urunList")
public class UrunList extends EntityQuery<Urun> {

	private static final String EJBQL = "select urun from Urun urun";

	private static final String[] RESTRICTIONS = { "lower(urun.adi) like lower(concat(#{urunList.urun.adi},'%'))", "lower(urun.ambalaj) like lower(concat(#{urunList.urun.ambalaj},'%'))", "lower(urun.barkod) like lower(concat(#{urunList.urun.barkod},'%'))", "lower(urun.paletadedi) like lower(concat(#{urunList.urun.paletadedi},'%'))", "lower(urun.upc) like lower(concat(#{urunList.urun.upc},'%'))", "lower(urun.urunno) like lower(concat(#{urunList.urun.urunno},'%'))", };

	private Urun urun = new Urun();

	public UrunList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Urun getUrun() {
		return urun;
	}
}
